<?php $attribute_key = isset($result->attribute_key) ? trim($result->attribute_key, ',') : '' ?>
<?php $attribute_key = explode(',', $attribute_key) ?>
<div class="alert alert-success ">商品属性</div>
<?php foreach ($attribute->result() as $key => $item) : ?>
<div class="control-group Father_Title">
    <div class="Father_Item">
        <label class="control-label attr_name"><?php echo $item->attr_name ?>：</label>
        <?php $spec_attr = $this->tourism_goods_category_spec->getSpecByAttId($item->attr_id); ?>
        <?php if ($spec_attr->result()) : ?>
            <div class="controls">
                <?php foreach ($spec_attr->result() as $val) : ?>
                    <label class="checkbox">
                        <input type="checkbox" name="attribute[]" value="<?php echo $val->spec_id ?>" <?php if (in_array($val->spec_id, $attribute_key)): ?>checked="checked" <?php endif; ?>/>
                        <?php echo $val->attribute_value ?>
                    </label>
                <?php endforeach; ?>
            </div>
        <?php endif; ?>
    </div>
</div>
<?php endforeach; ?>
